<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "cti_gw".
 */
class CtiGw extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     *  * This is the model class for table "cti_gw".
     *
     * @property int $id 网关的id
     * @property int $order_id 网关的顺序
     * @property string $password 鉴权密码（必须是明文，这个是移动给的密码）
     * @property string $number 网关的号码
     * @property string $bind_number 网关的绑定的电话号码
     * @property string $name 网关的名称
     * @property int $create_at 创建时间
     * @property int $update_at 修改时间
     */
    public static function tableName()
    {
        return 'cti_gw';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'order_id', 'create_at', 'update_at'], 'integer'],
            [['password', 'name'], 'string', 'max' => 30],
            [['number'], 'string', 'max' => 13],
            [['bind_number'], 'string', 'max' => 16],
            [['id'], 'unique'],
            [['update_at'],'default','value'=>time()],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_id' => 'Order ID',
            'password' => 'Password',
            'number' => 'Number',
            'bind_number' => 'Bind Number',
            'name' => 'Name',
            'create_at' => 'Create At',
            'update_at' => 'Update At',
        ];
    }
}
